import urllib.request

url = 'http://www.baidu.com'

# filename是下载完成之后, 保存文件的名称
# 下载网页
# urllib.request.urlretrieve(url=url, filename='baidu.html')

# 下载图片
url_image = 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1600269114178&di=fca4fcb8c0bfa8057b5b593a6e78487e&imgtype=0&src=http%3A%2F%2F00.imgmini.eastday.com%2Fmobile%2F20170927%2F20170927151425_d41d8cd98f00b204e9800998ecf8427e_4.jpeg'
# 403 Forbidden 禁止访问
urllib.request.urlretrieve(url=url_image, filename='../zms.jpg')
